Skip to content

feat(install): skip the download when that version is already installed - #2

Merged
slue merged 1 commit into
mainfrom
feat/install-skip-same-version
Oct 5, 2026
Merged

slue merged 1 commit into
mainfrom
feat/install-skip-same-version

Conversation

@slue

@slue slue commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Requested by Christoph on GC https://groundcontrol.makerslab.ai/tasks/c680a4fa-6c5c-49eb-982e-596d8c6c061d ("Bitte toolkit anpassen, dass gecheckt wird, ob es die Version schon gibt").

Why: the /agent ready_ prompt always starts with install.sh. The AgentFleet image ships gc in /usr/local/bin (ai-assistant-installation #368), so running the prompt there left a second, never-updated copy in ~/.local/bin.

What

  • Before downloading, install.sh compares the wanted version with <install-dir>/gc and with gc on PATH. The wanted version is --version, or else the latest release read off GitHub's /releases/latest redirect. On a match it prints "already installed — nothing to download" plus the next steps, using the path that has it.
  • --force reinstalls anyway.
  • If the latest version can't be determined (no curl, GC_INSTALL_BASE), it installs as before.
  • After an install it prints a note when another gc earlier on PATH shadows the new one.
  • installed_version only accepts output of the form gc X.Y.Z, with stdin set to /dev/null. Graphviz's gc therefore does not count as a match and cannot block on stdin.

Tested (macOS arm64, clean PATH)

Case Result
fresh install downloads
same version again skip
no --version (latest = 0.1.0) skip
--force reinstalls
same version on PATH in another dir skip, next steps use gc
older fake gc earlier on PATH installs, prints the shadow note

go vet, go test ./... and validate-skills.sh are green.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RKSbCZZYkipdDF4AueeXC9

The /agent ready_ setup prompt always starts with install.sh. On a machine
where gc is already there (the AgentFleet image bakes it into /usr/local/bin)
that left a second, never-updated copy in ~/.local/bin. Now install.sh checks
the install dir and `gc` on PATH against the wanted version (--version, else
the latest release via the /releases/latest redirect) and only prints the next
steps when it matches. --force reinstalls. After an install it notes when
another gc earlier on PATH shadows the new one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RKSbCZZYkipdDF4AueeXC9
@slue
slue merged commit 427a19a into main Oct 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant